<template>
   <div class="my">
      <div v-if="isToken">
         <button>退出</button>
      </div>
      <div v-else>
         <button>去登录</button>
      </div>
   </div>
</template>

<script>
import { UserApi } from '@/api'
import { mapGetters } from 'vuex'
export default {
   created() {
      this.userlogin()
   },
   computed: {
      ...mapGetters(['isToken'])
   },
   methods: {
      async userlogin() {
         const res = await UserApi()
         console.log(res)
      }
   }
}
</script>

<style>

</style>